import 'package:flutter/material.dart';


///
///   Padding
///  Padding可以给其子节点添加填充（留白），和边距效果类似
///   https://api.flutter-io.cn/flutter/widgets/Padding-class.html
///
///  EdgeInsetsGeometry
///  https://api.flutter-io.cn/flutter/painting/EdgeInsets-class.html
///
class PaddingPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
        appBar: AppBar(
          title: Text("填充（Padding）"),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          mainAxisSize: MainAxisSize.max,
          children: [
            Expanded(
              child: Padding(
                padding: EdgeInsets.all(8),
                child: Container(
                  color: Colors.red,
                  child: Padding(
                    padding: EdgeInsets.fromLTRB(4, 8, 10, 5),
                    child: Container(
                      color: Colors.blue,
                    ),
                  ),
                ),
              ),
              flex: 1,
            ),
            Expanded(
              child: Padding(
                padding: EdgeInsets.all(0),
                child: Container(
                  color: Colors.red,
                  child: Padding(
                    padding: EdgeInsets.symmetric(vertical:3,horizontal: 8),
                    child: Container(
                      color: Colors.blue,
                    ),
                  ),
                ),
              ),
              flex: 1,
            )
          ],
        ));
  }
}
